﻿@model ExtremeEvents.Models.Evento
@{
    ViewBag.Title = "Editar Evento";
}

<script type="text/javascript">
    //alterar estado dos botoes
    activarBotaoAreaCliente("gerir_eventos"); //alterar para o nome da view
</script>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
 


@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "Error_26: verifique se preencheu todos os campos obrigatórios corretamente.") 
    
    @Html.HiddenFor(m => m.id_evento)
    @Html.HiddenFor(m => m.id_utilizador)

    <div class="wrapper">
    <div class="grid_4" style="width:98%;">
	    <h3>Alterar evento</h3>
	    <div class="bg maxheight">
		    <div class="content-indents">
            <fieldset>
                <table>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.id_categoria)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.DropDownList("id_categoria")
                                @Html.ValidationMessageFor(m => m.id_categoria)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.Label("De:")</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">

                                @Html.EditorFor(m => m.data_inicio)
                                @Html.ValidationMessageFor(m => m.data_inicio)
                            </div>
                        </td>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.Label("Até:")</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.data_fim)
                                @Html.ValidationMessageFor(m => m.data_fim)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.titulo)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.titulo, new { style = "width:420px" })
                                @Html.ValidationMessageFor(m => m.titulo)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.descricao)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextAreaFor(m => m.descricao, new { style = "width:420px" })
                                @Html.ValidationMessageFor(m => m.descricao)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.preco)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.preco)
                                @Html.ValidationMessageFor(m => m.preco)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.codigo_postal)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.codigo_postal)
                                @Html.ValidationMessageFor(m => m.codigo_postal)
                            </div>
                        </td>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.latitude)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.latitude)
                                @Html.ValidationMessageFor(m => m.latitude)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.morada)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.morada)
                                @Html.ValidationMessageFor(m => m.morada)
                            </div>
                        </td>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.longitude)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.longitude)
                                @Html.ValidationMessageFor(m => m.longitude)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.url)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.url)
                                @Html.ValidationMessageFor(m => m.url)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.contacto_telefonico)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.contacto_telefonico)
                                @Html.ValidationMessageFor(m => m.contacto_telefonico)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.email)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.email)
                                @Html.ValidationMessageFor(m => m.email)
                            </div>
                        </td>
                    </tr>
                </table>
            </fieldset>
            </div>
        </div>
        <br />
        <div align="right" style="padding-right:20px; padding-bottom:10px;">
        <a href="/Utilizador/Index" class="button"><span>cancelar</span></a>
        <a href="javascript:$('form')[0].submit();" id="alterar" class="button"><span>alterar</span></a>
        </div>
    </div>
    </div>
}